package com.skp.shaphan.menus;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenuItem;

import com.skp.shaphan.ShaphanApp;
import com.skp.shaphan.actions.ShowMaintAction;

/**
 * Show the tables in the database
 * @author Stephen Phillips
 *
 */
public class MaintLogMenuItem extends JMenuItem implements ActionListener {
	ShowMaintAction action;
	
	/**
	 * Create the new menu item
	 */
	public MaintLogMenuItem() {
		super("Show Maintenance and Bundles");
		this.setMnemonic('M');
		this.addActionListener(this);
		action = new ShowMaintAction();
	}

	/**
	 * Execute when the menu is clicked
	 */
	@Override
	public void actionPerformed(ActionEvent e) {
		action.setEditor(ShaphanApp.getMainWindow().getSqlEditor());
		action.setResultPane(ShaphanApp.getMainWindow().getResultPane());
		action.run();
	}
}
